﻿#region 信息

// Copyright©2014 Rex Rao all rights reserved.
// File name : SoMcCoffee\Sohobloo.SoCommon\CollectionExtension.cs
// Author : Sohobloo
// Create time : 2014/02/07 10:51
// Update time : 2014/02/07 11:22

#endregion

#region 引用

using System.Collections.Generic;

#endregion

namespace Sohobloo.SoCommon.CommonExtension
{
    public static class CollectionExtension
    {
        public static void AddOrUpdate<T>(this ICollection<T> collection, T item)
        {
            ArgumentHelper.Instance
                          .CheckNull(collection)
                          .CheckNull(item);

            if(!collection.Contains(item))
            {
                collection.Add(item);
            }
        }
    }
}